package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.dto.IdRequest;
import com.sc.nft.feign.WxMiniThemeActivityClient;
import com.sc.nft.req.activity.ThemeActivityGoodsReq;
import com.sc.nft.req.activity.ThemeActivityPageReq;
import com.sc.nft.req.activity.ThemeActivityReq;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.activity.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/ipMall/wxMiniMall/user/activity")
@Api(tags = "用户端主题活动")
public class WxMiniThemeActivityController {

    private final WxMiniThemeActivityClient wxMiniThemeActivityClient;



    /**
     * 主题活动详情
     * @param idRequest
     * @return
     */
    @PostMapping(value = "/get", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "用户端主题活动详情")
    public Result<ThemeWebVO> webGet(@Valid @RequestBody IdRequest idRequest) {
        return wxMiniThemeActivityClient.webGet(idRequest);
    }

    /**
     * 主题活动商品
     * @param request
     * @return
     */
    @PostMapping(value = "/getGoods", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "用户端主题活动商品详情")
    public PageResult<ThemeItemWebVO> webGetGoods(@Valid @RequestBody ThemeActivityGoodsReq request) {
        return wxMiniThemeActivityClient.webGetGoods(request);
    }

}